package com.lx.router;

import com.lx.handler.UserHandler;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerResponse;

import static org.springframework.web.reactive.function.server.RequestPredicates.path;
import static org.springframework.web.reactive.function.server.RouterFunctions.nest;

/**
 * 总配置方式
 *
 * @author 段誉
 * @create 2019-05-15 15:22
 */
@Configuration
public class BusinessRouter {
  //指定总路由
  @Bean
  public RouterFunction<ServerResponse> user(UserHandler userHandler) {
    return nest(path("/api/user"), UserRouter.router(userHandler));
  }
}
